package com.tbs.easyhomemoneyserver.dao

import com.tbs.easyhomemoneyserver.DO.FlowTemplateItem
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Select
import tk.mybatis.mapper.additional.insert.InsertListMapper
import tk.mybatis.mapper.common.BaseMapper

@Mapper
interface FlowTemplateItemMapper : BaseMapper<FlowTemplateItem>, InsertListMapper<FlowTemplateItem> {
    @Select("select * from flow_template_item where template_id=#{arg0} order by flow_index")
    fun listItemsByTemplateId(templateId: Long): List<FlowTemplateItem>

    @Select("select fti.* from flow_node fn left join flow_template_item fti on fn.template_item_id = fti.id where fn.id=#{arg0}")
    fun findNextTemplateItemById(nodeId: Long): List<FlowTemplateItem>
}
